/**
* gtk_map_list_model_new:
- * @model: (allow-none): The model to map or %NULL for none
+ * @model: (transfer full) (allow-none): The model to map or %NULL for none
* @map_func: (allow-none): map function or %NULL to not map items
* @user_data: (closure): user data passed to @map_func
* @user_destroy: destroy notifier for @user_data
"model", model,
NULL);
+ /* consume the reference */
+ g_clear_object (&model);
+
if (map_func)
gtk_map_list_model_set_map_func (result, map_func, user_data, user_destroy);
gtk_property_lookup_list_model_set_object (self->model, object);
map_model = gtk_map_list_model_new (G_LIST_MODEL (self->model), map_to_controllers, NULL, NULL);
- g_object_unref (self->model);
flatten_model = gtk_flatten_list_model_new (G_LIST_MODEL (map_model));
GtkMapListModel *result;
GString *changes;
+ if (store)
+ g_object_ref (store);
result = gtk_map_list_model_new (G_LIST_MODEL (store), map_multiply, GUINT_TO_POINTER (2), NULL);
changes = g_string_new ("");
g_object_set_qdata_full (G_OBJECT(result), changes_quark, changes, free_changes);